package com.softdev.pojo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.softdev.common.AbstractBaseEntity;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.persistence.*;
import java.io.Serializable;

@ApiModel("项目风险中间表")
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "projects_risks")
public class ProjectRiskMapping extends AbstractBaseEntity implements Serializable {

    private static final long serialVersionUID = 8639485639172816041L;

    @JsonIgnore
    @ManyToOne
    @JoinColumn(name = "project_id")
    private Project project;

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "risk_id")
    private Risk risk;

    @ManyToOne
    @JoinColumn(name = "user_id")
    private User user;

    @Column(name = "sort")
    private int sort;

    @Column(name = "status")
    private int status;

}
